import request from '@/utils/request'
//  封装登录验证码请求
export const yanzhengma = (clientToken) => {
  return request({
    url: `user-service/user/imageCode/${clientToken}`,
    responseType: 'blob'
  })
}

// 封装登录请求
export const login = (data) => {
  return request({
    url: 'user-service/user/login',
    method: 'post',
    data
  })
}
// 封装工单统计请求
export const getWorkOrder = ({ start, end }) => {
  return request({
    url: `task-service/task/taskReportInfo/${start}/${end}`
  })
}
// 获取一定时间范围之内的订单总数
export const ordersTotal = ({ start, end }) => {
  return request({
    url: 'order-service/report/orderCount',
    params: { start, end }
  })
}
// 封装获取一定时间范围之内的收入
export const orderMoney = ({ start, end }) => {
  return request({
    url: 'order-service/report/orderAmount',
    params: { start, end }
  })
}
// 封装销售商品排行
export const productRank = ({ topValue, start, end }) => {
  return request({
    url: `order-service/report/skuTop/${topValue}/${start}/${end}`
  })
}
// 封装合作商点位汇总统计
export const CooperativeStatistics = () => {
  return request({
    url: 'vm-service/node/nodeCollect'
  })
}
// 封装销售折线图
export const saleLineFig = ({ collectType, start, end }) => {
  return request({
    url: `order-service/report/amountCollect/${collectType}/${start}/${end}`
  })
}
// 封装合作商点位汇总(饼图数据)请求
export const pointPieDate = () => {
  return request({
    url: 'vm-service/node/nodeCollect'
  })
}
// 封装饼图点位数请求
export const pieNumber = () => {
  return request({
    url: 'vm-service/node/count'
  })
}
// 封装饼图合作商数
export const pieHezuoNum = () => {
  return request({
    url: 'user-service/partner/count'
  })
}
